package cn.fintecher.pangolin.entity.elastic;

import cn.fintecher.pangolin.common.enums.NoticeType;
import cn.fintecher.pangolin.common.utils.Constants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;

import java.util.Date;

/**
 * @Auther: xiaqun
 * @Description: 公告实体
 * @Date: 9:56 2019/9/2
 */

@Data
@Document(indexName = Constants.NOTICE, type = Constants.NOTICE, shards = 1, replicas = 0)
@ApiModel(value = "公告实体", description = "公告实体")
public class Notice {
    @ApiModelProperty(value = "主键ID")
    @Id
    private String id;

    @ApiModelProperty(value = "类型")
    private NoticeType type;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "内容")
    private String content;

    @ApiModelProperty(value = "发布时间")
    private Date operateTime;

    @ApiModelProperty(value = "发布人")
    private String operatorName;

    public void process(String name, Date date) {
        this.operatorName = name;
        this.operateTime = date;
    }
}
